package com.winona.ui;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;

import com.taplinker.client.R;
import com.winona.Base1Activity;

public class OutpatientActivity extends Base1Activity {

	private ListView outpatient_lv;
	private ImageButton back;
	private Intent intent;
	private TextView title;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.outpatient_records);
		findView();
		Animation animRef = AnimationUtils.loadAnimation(this, R.anim.anim1);
		SimpleAdapter adapter = new SimpleAdapter(this, getData(),
				R.layout.sensivive_item, new String[] { "img", "description",
						"go", "name", "time" }, new int[] {
						R.id.outpatient_img, R.id.outpatient_description,
						R.id.outpatient_go, R.id.outpatient_name,
						R.id.outpatient_time });

		outpatient_lv.setAdapter(adapter);
		back.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				intent = new Intent(OutpatientActivity.this,
						PersonalSettingActivity.class);
				startActivity(intent);
				overridePendingTransition(R.anim.input, R.anim.out);
			}
		});

	}

	private void findView() {
		outpatient_lv = (ListView) findViewById(R.id.outpatient_lv);
		back = (ImageButton) findViewById(R.id.outpatient_back);
		title = (TextView) findViewById(R.id.outpatient_title);
		title.setText("门诊记录");
	}

	private List<Map<String, Object>> getData() {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> map = new HashMap<String, Object>();
		map = new HashMap<String, Object>();
		map.put("img", R.drawable.v5_0_1_widget_default_head);
		map.put("name", "讲座名称");
		map.put("go", R.drawable.jiantou1_disable);
		map.put("description", "皮肤粗糙的原因主要是因为皮脂过度分泌...");
		map.put("time", "2012-12-28 16:25:30");
		list.add(map);

		map.put("img", R.drawable.v5_0_1_widget_default_head);
		map.put("name", "讲座名称");
		map.put("go", R.drawable.jiantou1_disable);
		map.put("description", "皮肤粗糙的原因主要是因为皮脂过度分泌...");
		map.put("time", "2012-12-28 16:25:30");
		list.add(map);

		map.put("img", R.drawable.v5_0_1_widget_default_head);
		map.put("name", "讲座名称");
		map.put("go", R.drawable.jiantou1_disable);
		map.put("description", "皮肤粗糙的原因主要是因为皮脂过度分泌...");
		map.put("time", "2012-12-28 16:25:30");
		list.add(map);

		map.put("img", R.drawable.v5_0_1_widget_default_head);
		map.put("name", "讲座名称");
		map.put("go", R.drawable.jiantou1_disable);
		map.put("description", "皮肤粗糙的原因主要是因为皮脂过度分泌...");
		map.put("time", "2012-12-28 16:25:30");
		list.add(map);

		map.put("img", R.drawable.v5_0_1_widget_default_head);
		map.put("name", "讲座名称");
		map.put("go", R.drawable.jiantou1_disable);
		map.put("description", "皮肤粗糙的原因主要是因为皮脂过度分泌...");
		map.put("time", "2012-12-28 16:25:30");
		list.add(map);

		map.put("img", R.drawable.v5_0_1_widget_default_head);
		map.put("name", "讲座名称");
		map.put("go", R.drawable.jiantou1_disable);
		map.put("description", "皮肤粗糙的原因主要是因为皮脂过度分泌...");
		map.put("time", "2012-12-28 16:25:30");
		list.add(map);

		map.put("img", R.drawable.v5_0_1_widget_default_head);
		map.put("name", "讲座名称");
		map.put("go", R.drawable.jiantou1_disable);
		map.put("description", "皮肤粗糙的原因主要是因为皮脂过度分泌...");
		map.put("time", "2012-12-28 16:25:30");
		list.add(map);

		map.put("img", R.drawable.v5_0_1_widget_default_head);
		map.put("name", "讲座名称");
		map.put("go", R.drawable.jiantou1_disable);
		map.put("description", "皮肤粗糙的原因主要是因为皮脂过度分泌...");
		map.put("time", "2012-12-28 16:25:30");
		list.add(map);

		return list;
	}

}
